if ((position < 0) || (position > nchildren))
position = nchildren;
- priv->children = g_list_insert (priv->children, page, position);
+ priv->children = g_list_insert (priv->children, g_object_ref (page), position);
if (position < nchildren)
sibling = GTK_NOTEBOOK_PAGE_FROM_LIST (g_list_nth (priv->children, position))->tab_widget;
gint position)
{
GtkNotebookPage *page;
+ int ret;
page = g_object_new (GTK_TYPE_NOTEBOOK_PAGE,
"child", child,
"menu", menu_label,
NULL);
- return gtk_notebook_insert_notebook_page (notebook, page, position);
+ ret = gtk_notebook_insert_notebook_page (notebook, page, position);
+
+ g_object_unref (page);
+
+ return ret;
}
static gboolean